home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / sunrpc / Makefile < prev    next >
Makefile  |  1994-05-18  |  5KB  |  128 lines

  1. # Copyright (C) 1994 Free Software Foundation, Inc.
  2. # This file is part of the GNU C Library.
  3.  
  4. # The GNU C Library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Library General Public License as
  6. # published by the Free Software Foundation; either version 2 of the
  7. # License, or (at your option) any later version.
  8.  
  9. # The GNU C Library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. # Library General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU Library General Public
  15. # License along with the GNU C Library; see the file COPYING.LIB.  If
  16. # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. # Cambridge, MA 02139, USA.
  18.  
  19. #
  20. #    Sub-makefile for sunrpc portion of the library.
  21. #
  22. subdir    := sunrpc
  23.  
  24. # The code in this subdirectory is taken verbatim from Sun's RPCSRC-4.0
  25. # distribution.  A few files needed trivial modifications to compile in the
  26. # GNU environment; these changes are marked by comments that say
  27. # `roland@gnu'.  All the code from Sun's rpc, etc, and rpcgen
  28. # subdirectories is in this directory; the rpc subdirectory contains only
  29. # the header files.  Other than that, several files were renamed so as not
  30. # to exceed 14-character file name limits:
  31. #
  32. #    authunix_prot.c -> authuxprot.c
  33. #    bindresvport.c -> bindrsvprt.c
  34. #    clnt_generic.c -> clnt_gen.c
  35. #    clnt_perror.c -> clnt_perr.c
  36. #    clnt_simple.c -> clnt_simp.c
  37. #    get_myaddress.c -> get_myaddr.c
  38. #    pmap_getmaps.c -> pm_getmaps.c
  39. #    pmap_getport.c -> pm_getport.c
  40. #    rpc_callmsg.c -> rpc_cmsg.c
  41. #    rpc_commondata.c -> rpc_common.c
  42. #    rpc_dtablesize.c -> rpc_dtable.c
  43. #    svc_auth_unix.c -> svc_authux.c
  44. #    xdr_reference.c -> xdr_ref.c
  45. #    rpcsvc/bootparam_prot.x -> rpcsvc/bootparam.x
  46.  
  47. headers = $(addprefix rpc/,auth.h auth_unix.h clnt.h netdb.h pmap_clnt.h \
  48.                pmap_prot.h pmap_rmt.h rpc.h rpc_msg.h svc.h \
  49.                svc_auth.h types.h xdr.h) \
  50.       $(rpcsvc:%=rpcsvc/%) $(rpcsvc:%.x=rpcsvc/%.h)
  51. rpcsvc = bootparam.x nlm_prot.x rstat.x \
  52.      yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
  53.      rnusers.x spray.x nfs_prot.x rquota.x yp.x
  54. install-others = $(includedir)/rpcsvc/bootparam_prot.h \
  55.          $(etcdir)/rpc
  56. generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c)
  57.  
  58. routines := auth_none auth_unix authuxprot bindrsvprt \
  59.         clnt_gen clnt_perr clnt_raw clnt_simp clnt_tcp \
  60.         clnt_udp rpc_dtable get_myaddr getrpcent getrpcport \
  61.         pmap_clnt pm_getmaps pm_getport pmap_prot \
  62.         pmap_prot2 pmap_rmt rpc_prot rpc_common rpc_cmsg \
  63.         svc svc_auth svc_authux svc_raw svc_run svc_simple \
  64.         svc_tcp svc_udp xdr xdr_array xdr_float xdr_mem \
  65.         xdr_rec xdr_ref xdr_stdio
  66.  
  67. install-lib := librpcsvc.a
  68. install := rpcgen rpcinfo portmap
  69. rpcsvc-objs = $(rpcsvc:%.x=x%.o)
  70. rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
  71.           rpc_scan.o rpc_util.o rpc_svcout.o rpc_clntout.o
  72. extra-objs = $(rpcgen-objs) $(rpcsvc-objs)
  73. omit-deps = $(basename $(rpcsvc-objs))
  74. # These headers are part of rpcgen.
  75. distribute := rpc_util.h rpc_parse.h rpc_scan.h $(rpcgen-objs:.o=.c) etc.rpc
  76.  
  77. others := portmap rpcinfo
  78.  
  79. # Sun's code is not too clean.
  80. override +gccwarn := -w
  81.  
  82. include ../Rules
  83.  
  84. $(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) $(libc.a)
  85.     $(+link)
  86.  
  87. rpcgen-cmd = $(dir $(word 2,$^))$(notdir $(word 2,$^))
  88.  
  89. # The proper file name is longer than 14 chars, so we install it under
  90. # a shorter name.  But if the filesystem can handle it, we want to
  91. # install under the proper name as well.
  92. $(includedir)/rpcsvc/bootparam_prot.h: $(includedir)/rpcsvc/bootparam.h
  93.     @echo It is safe to ignore an error here if this file name is too long.
  94.     -$(do-install)
  95.  
  96. # Install the rpc data base file.
  97. $(etcdir)/rpc: etc.rpc
  98.     $(do-install)
  99.  
  100. defines := $(defines) -D_PATH_RPC='"$(etcdir)/rpc"'
  101.  
  102. # Build the `rpcsvc' library of XDR functions.
  103.  
  104. lib: $(objpfx)librpcsvc.a
  105.  
  106. $(objpfx)librpcsvc.a: $(addprefix $(objpfx),$(rpcsvc-objs))
  107. # This library is small enough that it's simplest to recreate the archive
  108. # from scratch each time.
  109.     rm -f $@
  110. ifdef objdir
  111.     cd $(objdir); $(AR) cq$(verbose) $@ $(^:$(objpfx)%=%)
  112. else
  113.     $(AR) cq$(verbose) $@ $^
  114. endif
  115.     $(RANLIB) $@
  116.  
  117. # Generate the rpcsvc headers with rpcgen.
  118. $(objpfx)rpcsvc/%.h: rpcsvc/%.x $(objpfx)rpcgen
  119.     $(make-target-directory)
  120.     $(rpcgen-cmd) -h $< -o $@
  121. # Generate the rpcsvc XDR functions with rpcgen.
  122. $(objpfx)x%.c: rpcsvc/%.x $(objpfx)rpcgen
  123.     $(rpcgen-cmd) -c $< -o $@
  124. # The generated source files depend on the corresponding generated headers.
  125. # Gratuitous dependency on generated .c file here just gets it mentioned to
  126. # avoid being an intermediate file and getting removed.
  127. $(rpcsvc:%.x=$(objpfx)x%.o): $(objpfx)x%.o: $(objpfx)x%.c $(objpfx)rpcsvc/%.h
  128.